package com.mec.offload.service.impl;


import com.mec.offload.dao.AltTaskMapper;
import com.mec.offload.model.AltTask;
import com.mec.offload.service.AltTaskService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AltTaskServiceImpl implements AltTaskService {
    @Autowired
    AltTaskMapper altTaskMapper;
    public List<AltTask> getTaskByTermId(int termId)
    {
        try{
            return altTaskMapper.getTaskByTermId(termId);
        }catch (Exception e)
        {
            e.printStackTrace();
        }
        return null;
    }
    public int updateTaskDepart(Integer TaskId){
        try {
            return altTaskMapper.updateTaskDepart(TaskId);
        }catch (Exception e){
            e.printStackTrace();
            return 0;
        }
    }
    public int updateTaskJudge(Integer TaskId){
        try {
            return altTaskMapper.updateTaskJudge(TaskId);
        }catch (Exception e){
            e.printStackTrace();
            return 0;
        }
    }
    public List<AltTask> getAllTaskDone(){
        try {
            return altTaskMapper.getAllTaskDone();
        }catch (Exception e){
            e.printStackTrace();
            return null;
        }
    }


    public List<AltTask> queryAllDataFromTable(int page, int limit, int termId){
        page=(page-1)*limit;
        return altTaskMapper.queryAllDataFromTable(page, limit, termId);
    }
    public int queryfuAllCount(Integer termId){return altTaskMapper.queryfuAllCount(termId);}

}
